<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>ArcGIS API 示例 - TileLayer</title>
    <link rel="stylesheet" href="https://js.arcgis.com/4.6/esri/css/main.css">
    <script src="https://js.arcgis.com/4.6/"></script>
    <style>
        html,
        body,
        #viewDiv {
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
</head>

<body>
    <div id="viewDiv"></div>
    <script>
        require([
            "esri/Map",
            "esri/views/MapView",
            "esri/layers/TileLayer"
        ], function (Map, MapView, TileLayer) {
            // 创建地图
            var map = new Map({
                basemap: "topo-vector" // 设置基础地图
            });

            // 创建地图视图
            var view = new MapView({
                container: "viewDiv", // 将视图附加到 div
                map: map,
                center: [104.0668, 30.6594], // 设置中心点（经度, 纬度）
                zoom: 4 // 设置缩放级别
            });

            // 创建切片图层
            var imageryLayer = new TileLayer({
                url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
            });

            // 将切片图层添加到地图
            map.add(imageryLayer);
        });
    </script>
</body>

</html>